{include file="public/header" /}



<div class="page">
    <form id="post_form" method="post" name="form1">
        <table class="ds-default-table">
            <tbody>
            <tr class="noborder">
                <td class="required w120"><label class="validation" for="helptype_name">{$Think.lang.helptype_name}:</label></td>
                <td class="vatop rowform"><input id="helptype_name" name="helptype_name" value="{$type.helptype_name}" class="txt" type="text"></td>
                <td class="vatop tips"></td>
            </tr>
            <tr class="noborder">
                <td class="required"><label class="validation" for="helptype_sort">{$Think.lang.ds_sort}:</label></td>
                <td class="vatop rowform"><input type="text" value="{$type.helptype_sort}" name="helptype_sort" id="helptype_sort" class="txt"></td>
                <td class="vatop tips">{$Think.lang.helptype_sort_tips}</td>
            </tr>
            <tr class="noborder">
                <td class="required">{$Think.lang.ds_display}:</td>
                <td class="onoff">
                    <label for="show1" class="cb-enable {eq name='type.helptype_show' value='1'}selected{/eq}" title="{$Think.lang.ds_yes}"><span>{$Think.lang.ds_yes}</span></label>
                    <label for="show0" class="cb-disable {neq name='type.helptype_show' value='1'}selected{/neq}" title="{$Think.lang.ds_no}"><span>{$Think.lang.ds_no}</span></label>
                    <input id="show1" name="helptype_show" {eq name='type.helptype_show' value='1'}checked="checked"{/eq}  value="1" type="radio">
                    <input id="show0" name="helptype_show" {neq name='type.helptype_show' value='1'}checked="checked"{/neq} value="0" type="radio"></td>
                <td class="vatop tips"></td>
            </tr>
            </tbody>
            <tfoot>
            <tr class="tfoot">
                <td colspan="15" ><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
            </tr>
            </tfoot>
        </table>
    </form>

</div>

<script>
    //按钮先执行验证再提交表单
    $(function(){
        $("#post_form").validate({
            errorPlacement: function(error, element){
                error.appendTo(element.parent().parent().find('td:last'));
            },
            rules : {
                helptype_name : {
                    required : true
                },
                helptype_sort : {
                    required : true,
                    digits   : true
                }
            },
            messages : {
                helptype_name : {
                    required : "{$Think.lang.helptype_name_required}"
                },
                helptype_sort  : {
                    required : "{$Think.lang.helptype_sort_digits}",
                    digits   : "{$Think.lang.helptype_sort_digits}"
                }
            }
        });
    });

</script>